<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../js/li_jing/bootstrap-3.3.5-dist/css/bootstrap.css">
  <script src="../../js/li_jing/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
  <script src="../../js/li_jing/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>

  <style>
    * {
      margin: 0px;
      padding: 0px;
    }

    .contentbox {
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 20px 40px 10px 30px;


    }

    .headbox {
      width: 98%;
      border-bottom: 1px solid #f2f2f2;
      font-size: 16px;
      line-height: 36px;

    }

    .main {
      margin-top: 50px;
    }

    .main>input {
      height: 28px;
      margin-left: 14px;
      margin-right: 20px;
      border-radius: 4px;
      border: 1px solid rgba(217, 217, 217, 1);
    }

    .main input::-webkit-input-placeholder {
      color: #999999;
      font-size: 12px;
    }

    #stay {
      width: 94px;
      height: 28px;
      background-color: #169bd5;
      color: #ffffff;
      text-align: center;
      border: none;
      border-radius: 4px;
    }

    #cancel {
      margin-left: 5px;
      width: 94px;
      height: 28px;
      background-color: #f2f2f2;
      color: #333333;
      text-align: center;
      border: none;
      border-radius: 4px;
    }

    .yujingzhibox {
      display: none;
      margin-top: 20px;
      /* display: flex; */
      justify-content: start;
    }
  </style>
</head>

<body>
  <div class="contentbox">
    <div class="headbox">
      <p>库存预警</p>
    </div>

    <div class="main">
      <span>库存预警值</span>
      <input type="text" placeholder="输入预警值" id="yujingzhi">
      <button id="stay">保存</button>
      <button id="cancel">取消</button>
    </div>

    <div class="yujingzhibox">
      <span style="margin-right: 20px;">库存预警值</span>
      <span id="baocunzhiBox"></span>
    </div>
  </div>



  <script>
    $('#stay').click(function () {

      $('.yujingzhibox').css('display', 'block')


      let yujingzhi = $('#yujingzhi').val()

      if (yujingzhi != '') {
        alert('保存成功')
        $('#baocunzhiBox').append(`${yujingzhi}`)
        $('#yujingzhi').val('')
      }
    })
    $('#cancel').click(function () {
      console.log('前面输入框清空')
      $('#yujingzhi').val('')

    })
  </script>

































</body>

</html>